/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.core.service.base;

import org.springframework.cache.Cache;

/**
 * Usage: Cache服务类
 *
 * @author Charkey
 * @date 2016/5/18 15:24
 */
@Deprecated
public interface CacheService {

    /**
     * 通过缓存块名称获取缓存块
     *
     * @param cacheName 缓存块名称
     * @return Cache
     */
    Cache getCache(String cacheName);

    /**
     * 获取指定缓存块中的缓存，当缓存不存在时返回null
     *
     * @param cacheName 缓存块
     * @param key       缓存key
     * @return 缓存value
     */
    Object get(String cacheName, Object key);

    /**
     * 在指定缓存块中的创建新缓存对象
     *
     * @param cacheName 缓存块
     * @param key       缓存key
     * @param value     缓存value
     */
    void put(String cacheName, Object key, Object value);

    /**
     * 删除指定缓存块中的缓存
     *
     * @param cacheName 缓存块
     * @param key       缓存key
     */
    void evict(String cacheName, Object key);

    void clear(String cacheName);

}
